﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Net;
using System.Text.RegularExpressions;

namespace RaveEngine.Engine
{
    public class XmlScrape : BaseScrape
    {
        #region Properties

        /// <summary>
        /// Internal param exposing the output from the uriSource.
        /// </summary>
        public override string responseSource
        {
            get
            {
                if (m_responseSource == null)
                {
                    HttpWebRequest request = HttpWebRequest.Create(uriSource) as HttpWebRequest;             
                    HttpWebResponse response = request.GetResponse() as HttpWebResponse;
                    using (StreamReader responseStream = new StreamReader(response.GetResponseStream()))
                    {
                        m_responseSource = responseStream.ReadToEnd();
                    }
                }
                return m_responseSource;
            }
        }
        private string m_responseSource = null;



        #endregion

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sUrl"></param>
        public XmlScrape(string sUrl) : base(sUrl) { }


    }
}
